package com.loong.android.views.utils;

import android.graphics.Outline;
import android.os.Build;
import android.view.View;
import android.view.ViewOutlineProvider;

import androidx.annotation.RequiresApi;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public class ViewCornerOutLineProvider extends ViewOutlineProvider {
    private float corner = 0;
    public ViewCornerOutLineProvider(float corner) {
        this.corner = corner;
    }
    @Override
    public void getOutline(View view, Outline outline) {
        outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), corner);
    }
}
